<?php
// $Id:

$GLOBALS['recurring'] = array(
    'no',
    'Daily',
    'Weekly',
    'Monthly',
    'Quarterly',
    'Semi'
);

$GLOBALS['title'] = array(
    'Mr.',
    'Ms.',
    'Mrs.',
);

function show_select ($name, $list, $match='', $options='')
{
    echo '<select name="'.$name.'" '.$options.'>';
    echo '<option value="">-select-</option>';
    if (empty($list)) {
        $list = array();
    }
    foreach ($list as $item) {
        echo '<option value="'.$item.'"';
        if ($item == $match) {
            echo ' selected';
        }
        echo '>'.$item.'</option>';
    }
    echo '</select>';
}
//select for database queries
function show_select3 ($id, $value, $name, $list, $match='', $options='')
{
    #echo '<option value="">&nbsp;&nbsp;&nbsp;&nbsp;</option>';
    echo '<select id="'.$name.'" name="'.$name.'" '.$options.'>';
    if (empty($list)) {
        $list = array();
    }
    foreach ($list as $item) {
        echo '<option value="'.$item[$id].'"';
        if ($item[$id] == $match) {
            echo ' selected';
        }
        echo '>'.$item[$value].'</option>';
    }
    echo '</select>';
}
function show_select5($name, $list, $match='', $options='')
{
    echo '<select name="'.$name.'" '.$options.'>';
    echo '<option value="">--select--</option>';
    if (empty($list)) {
        $list = array();
    }
    foreach ($list as $key => $item) {
        echo '<option value="'.$key.'"';
        if ($item == $match) {
            echo ' selected';
        }
        echo '>'.$item.'</option>';
    }
    echo '</select>';
}
function datetimenow(){
	return date("F j, Y, g:i a");
}
function datetimef($date){
	return date("F j, Y, g:i a",strtotime($date));
}
function datef($date){
	return date("F j, Y",strtotime($date));
}
function monthf($date){
	return date("F",strtotime($date));	
}

?>
